{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "讲师： 沈福利\n",
    "\n",
    "本章节目标\n",
    "\n",
    "1. 绘制一个简单的直方图\n",
    "2. 直方图增加风格\n",
    "3. 泰坦尼克号的数据 绘制直方图\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 直方图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "横坐标分成一定数量的小区间（也叫做： 箱子）,每个箱子用矩形展示该箱子的箱子数（也就是y）\n",
    "\n",
    "在matplotlib 中，我们可以plt.hist(x,bins = 10)\n",
    "\n",
    "x 一组数据，bins 代表直方图中的箱子数量，默认 ＝ 10"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 绘制一个简单的图表"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 简单的图表"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "创建一个随机的一堆数组，然后用 matplotlib 进行直方图展示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "data =  [-0.87783858  1.16300186  1.59682934  0.06148522  0.63510909]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwO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1/CdjPBrg6vpa83L08qfvaED2ykqaKHiDJFUmeAu4F/qzvPGtwLfAPfYdolLfm6EGSWeBc4Jv9JhlNkhOS7AOOAPdX1YbIvZLmir6qvtQt11wO/HXfeVYjyXtYKvq/6DtLo4bemkOT1S2n3gXcWFUv9p1nFFX1alVtZ+l/1ucn2RDLZSvZ8EWf5Lruw9d9Sd5+dLz77+7ZSTb1GO+YXp+7+0zhc8COqvph3/mWc6y/6w1k6K05NDndGvddwB1VdXffeVarqv4T+Ffg4p6jjG3DF31Vfbqqtnc/gX+p+zCFJOcBbwbWZWm+LveJwN3A1VX17Z6jHdNg5qraiAXprTmOk+7f4a0snWRwc995RpVkJsmp3fNfBH4feKrfVOOb2pWxPfkj4P1Jfgr8N/AnAx/Ormd/CfwK8Jnu59Qr6/1mSkl+FZgHfhn4WZIbgXPW83/PN+qtOZJ8AbgQ2JRkAfhoVd3ab6qhLgCuBh7r1rsBPtJdMb+ebQb2dmdovYmlM/e+0nOmsTV1eqUk6Y02/NKNJGllFr0kNc6il6TGWfSS1DiLXpIaZ9FLUuMseklqnEUvSY37X9fPqVH7hXFDAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = np.random.randn(1000)\n",
    "print('data = ',data[0:5])\n",
    "ax = plt.hist(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这个hist 函数有多个选项，下面提供一个绘制直方图的例子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGx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FzI8heGbDmrcl8AfAJ4Z1Vt2T2MV2auqnksxSHbZ2gCRv8f3sPyhQIfmHWeoZLsSPIdo8ffAlwDfHG2qc5fh+9Q/WngF5K8BPw3y98CNQ9/dh9ieVvkPxr9bjqz1TctSvLdwCLwbcA3krwH2LOV//Q+2/YZM461oSR/Brwd2J5kCfitqrpntqk29KPAO4EvjNavAX59dIf7VnYJ8MejK6tew/IVd5+ccabzNveXQkqSXm0ul2UkSeuz3CWpIctdkhqy3CWpIctdkhqy3CWpIctdkhqy3CWpof8FIgRTPxn9eCEAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ax = plt.hist(data,bins = 30,normed=True,alpha= 0.5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 增加风格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAD8tJREFUeJzt3X+MZWV9x/H3p2CtPwO4C4Fl0qVma10bXcyU0JK0q9gKtOlqIg2kxY0hWZOixcakon9Uk4bEJv6qidKsQsVIoUSxbBqwwurGGCu64AYX1i0boMy4291BRagaLeu3f8zZel1mZ+7M3Dt37sP7ldzce585597P/shnnnnmnHNTVUiS2vUrow4gSRoui16SGmfRS1LjLHpJapxFL0mNs+glqXEWvSQ1zqKXpMZZ9JLUuJNHHQBgzZo1tX79+lHHkKSxcu+99z5eVWsX2m5VFP369evZvXv3qGNI0lhJ8l/9bOfSjSQ1zqKXpMZZ9JLUOIt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dDDwvycnA8znunJ9RqaqvAN8/bngLcGP3+EbgDf28lkW/gO47/huBfxx1lj5dCazGazeP1WUxkqwHzgXuGW2SE/oI8DfAz0cd5AR+A5gB/qlbXvpkkheMOtTxquq7wAeAx4BDwA+r6oujTTWvM6rqEMxOTIDT+9nJol/YR4B3VdXRUQdZSJLXMFv07xp1ljkseFmM1SLJC5n9Ce4dVfXkqPMcL8mfAEeq6t5RZ5nHycCrgeuq6lzgR/S5zLCSujXuLcA5wFnAC5L8xWhTDZ5FP4ckVyXZk2QPMAnckuRR4E3Ax5P09ePSMPVmTHJWklcy+2P8lqr63qjzzWHBy2KsBkmew2zJ31RVt406zwlcAPxp93/yFuC1ST4z2kjPMA1MV9Wxn4g+y2zxrzavAx6pqpmq+l/gNuD3RpxpPoeTnAnQ3fe1nGzRz6GqPlZVm7rbOVW1vqrWM/uf9S+r6l9HHPGXMjI7e7oNuKKq/nPE0U5k1V8WI0mYXVPeV1UfGnWeE6mqd1fV2d3/ycuAL1XVqpqFVtV/A1NJXtYNXQisxs+jeAw4P8nzu3//C1mFvzTusQPY2j3eCtzez07j/1GCAvhb4CXM/rQB8PRqu0DTmFwW4wLgCuDb3U9zAO/pzvLW4r0duKn7xv4w8JYR53mGqronyWeB+5g96upbrJKj1pLcDGwG1iSZBt4LvB+4NcmVzH6TurSv1/LMWElqm0s3ktQ4i16SGmfRS1LjLHpJapxFL0mNs+glqXEWvSQ1zqKXpMb9H7zg/MkJfNlbAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x1 = np.random.normal(0,0.8,1000)\n",
    "x2 = np.random.normal(-2,1,1000)\n",
    "x3 = np.random.normal(3,2,1000)\n",
    "\n",
    "\n",
    "# histtype :直方图的类型\n",
    "kwargs = dict(histtype='stepfilled',alpha = 0.3)\n",
    "ax1 = plt.hist(x1,**kwargs)\n",
    "ax2 = plt.hist(x2,**kwargs)\n",
    "ax3 = plt.hist(x3,**kwargs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 泰坦尼克号的数据 绘制直方图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 设置字体大小和图表的大小\n",
    "plt.rc('figure',figsize = (12,9))\n",
    "plt.rc('font',size = 15)\n",
    "# 中文乱码问题\n",
    "from matplotlib.font_manager import _rebuild\n",
    "_rebuild()\n",
    "plt.rcParams['font.sans-serif']=[u'SimHei']\n",
    "plt.rcParams['axes.unicode_minus']=False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   survived  pclass     sex   age  sibsp  parch     fare embarked  class  \\\n",
       "0         0       3    male  22.0      1      0   7.2500        S  Third   \n",
       "1         1       1  female  38.0      1      0  71.2833        C  First   \n",
       "2         1       3  female  26.0      0      0   7.9250        S  Third   \n",
       "3         1       1  female  35.0      1      0  53.1000        S  First   \n",
       "4         0       3    male  35.0      0      0   8.0500        S  Third   \n",
       "\n",
       "     who  adult_male deck  embark_town alive  alone  \n",
       "0    man        True  NaN  Southampton    no  False  \n",
       "1  woman       False    C    Cherbourg   yes  False  \n",
       "2  woman       False  NaN  Southampton   yes   True  \n",
       "3  woman       False    C  Southampton   yes  False  \n",
       "4    man        True  NaN  Southampton    no   True  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "titanic = pd.read_csv('data/titanic.csv',index_col=0)\n",
    "titanic.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(891, 15)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "titanic.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 891 entries, 0 to 890\n",
      "Data columns (total 15 columns):\n",
      "survived       891 non-null int64\n",
      "pclass         891 non-null int64\n",
      "sex            891 non-null object\n",
      "age            714 non-null float64\n",
      "sibsp          891 non-null int64\n",
      "parch          891 non-null int64\n",
      "fare           891 non-null float64\n",
      "embarked       889 non-null object\n",
      "class          891 non-null object\n",
      "who            891 non-null object\n",
      "adult_male     891 non-null bool\n",
      "deck           203 non-null object\n",
      "embark_town    889 non-null object\n",
      "alive          891 non-null object\n",
      "alone          891 non-null bool\n",
      "dtypes: bool(2), float64(2), int64(4), object(7)\n",
      "memory usage: 99.2+ KB\n"
     ]
    }
   ],
   "source": [
    "titanic.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们主要用于age 坐直方图的展示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAIOCAYAAABDMzCbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHj5JREFUeJzt3X20ZXdd3/HP10xNC4FMkJsKhDiIVnlYijgR0ASS0kWQsIyAtgo+wIIMLlYVy5ISAyJa4orIoihIF+GhNgUEl08UY1AMECCYmEGpSkWBzCAJgV6cTAN5kozf/nHOtGdu7uR3J+fMPTOZ12uts2bOb+87+5df9ty8s2efPdXdAQAADu5rlj0BAAA40olmAAAYEM0AADAgmgEAYEA0AwDAgGgGAIAB0QwAAAOiGQAABkQzAAAMiGYAABjYsuwJrOf+979/b9u2bdnTAADgHuxjH/vYl7p7ZSP7HpHRvG3btuzcuXPZ0wAA4B6sqj670X3dngEAAAOiGQAABkQzAAAMiGYAABgQzQAAMCCaAQBgQDQDAMCAaAYAgAHRDAAAA6IZAAAGRDMAAAyIZgAAGBDNAAAwIJoBAGBANAMAwIBoBgCAAdEMAAADohkAAAZEMwAADIhmAAAYEM0AADCwZaM7Vt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nOQdSU5Y9nxnX8fkc5oBAOBQHKv3NAMAwIaJZgAAGBDNAAAwIJoBAGBANAMAwIBoBgCAAdEMAAADohkAAAb+LxxSIew3eLLTAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 864x648 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "age = titanic['age'].dropna()\n",
    "_,ax = plt.subplots()\n",
    "p = ax.hist(x = age)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
